<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="fn" uri="jstl-fn" %>
<script type="text/javascript">
    function valida( ) {
        var aceptar = confirm("Are the data correct?") ;
        if ( aceptar == false )
            return false ;
        return true ;
    }
</script>
<c:set value="${MCCatalogs.allActiveRoles}" var="ActiveRoles" />
<c:set value="${fn:length(ActiveRoles)}" var="ActiveRolesLength" />
					<div id="bodyContent">
						<h1>Create new user</h1>
						<c:if test="${result eq 2}">
                                                    This email is already registered
                                                    <br>    
                                                    <br>    
                                                </c:if>
						<center>
						<html:form action='CrearUsuarioMostrarNiveles.do' method='post' focus="campo1" onsubmit="return valida(this);" >
						<html:hidden property="catalogoId" value="13"/>
						<html:hidden property="operation" value="1"/>
						<br/>
						
						<div class='errors'>
						<html:errors/>
						</div>
						
						<table class="TablaCatalogosNuevoTipoCuenta">
							<thead>
								<tr>
									<th>
										New user
									</td>
								</tr>
							</thead>
							<tr>
								<td>
									<br/>
									<table class='TablaCatalogosFields'>
										<tr>
											<td class='TDLabel'>
												Login: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:text property="campo1" styleClass='TextField' value="${campo1}" />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Password: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:password property="campo4" styleClass='TextField' value="${campo4}" />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Name: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:text property="campo3" styleClass='TextField' value="${campo3}" />
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Email: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:text property="campo2" styleClass='TextField' value="${campo2}" />
											</td>
										</tr>
                                                                                <tr>
											<td class='TDLabel'>
												Country: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:select property='campoInt1' >
<c:forEach items="${ActivePaises}" var="pais">
						<html:option value='${pais.cvePais}' >${pais.nombre} - ${pais.codigo}</html:option>
</c:forEach>						
                                                                                                </html:select>
											</td>
										</tr>
										<tr>
											<td class='TDLabel'>
												Roles: &nbsp;&nbsp;
											</td>
											<td class='TDField'>
												<html:select property="campoIntArr1" multiple="true" size="${ActiveRolesLength}">
<c:forEach items="${ActiveRoles}" var="rol">
													<option value="${rol.cveRole}">${rol.nombre}</option>
</c:forEach>
												</html:select>
											</td>
										</tr>
                                                                                
										<tr>
											<td colspan='2' class='TDButton'>
												<html:submit value='Assign levels' styleClass="ButtonSubmit" />
											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
						</html:form>
						</center>
					</div>
					<div id="footContent"></div>
